package com.twu.biblioteca;

public class Movie {
    private String name;
    private String year;
    private String director;
    private int rating = 0;

    public Movie(String name, String year, String director) {
        this.name = name;
        this.year = year;
        this.director = director;
    }

    public Movie(String name, String year, String director, int rating) {
        this(name, year, director);
        setRating(rating);
    }

    public void setRating(int rating) {
        this.rating = rating;
    }

    @Override
    public String toString() {
        return name + " " + year + " " + director + " " + (rating == 0 ? "N/A" : String.valueOf(rating));
    }
}
